# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=zanshin
pkgver=24.08.2
pkgrel=0
pkgdesc="A Getting Things Done application which aims at getting your mind like water"
# armhf blocked by qt6-qtdeclarative
# armv7, ppc64le and s390x blocked by qt6-qtwebengine -> akonadi-calendar
# loongarch64 blocked by akonadi-calendar
arch="all !armhf !armv7 !ppc64le !s390x !riscv64 !loongarch64"
url="https://zanshin.kde.org/"
license="(GPL-2.0-only OR GPL-3.0-only) AND LGPL-2.0-or-later"
makedepends="
	akonadi-calendar-dev
	boost-dev
	extra-cmake-modules
	ki18n-dev
	kontactinterface-dev
	krunner-dev
	kwindowsystem-dev
	qt6-qtbase-dev
	samurai
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/pim/zanshin.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/zanshin-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	local skipped_tests="tests-units-(widgets-pageview"
	local tests="
		akonadi-akonadi(serializer|storage|cachingstorageintegration)
		migrator-zanshin(021migration|contextitemsmigration)
		"
	for test in $tests; do
		skipped_tests="$skipped_tests|$test"
	done
	skipped_tests="$skipped_tests)test"
	xvfb-run ctest --test-dir build --output-on-failure -E "$skipped_tests"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
26653c6ee14a703762ead3c9199194c4eb8d159c2e8ecf7b2eaa43b73f8a6d27fc974f84ea65d6ef88b0d41e61abe2d01b9c9b62a3ebd84a6b5708f6ce7f746b  zanshin-24.08.2.tar.xz
"
